#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
    int num = 0;
    scanf("%d", &num);
    int a = 0;
    int b = 0;
    int c = 0;
    int d = 0;
    a = num % 10;
    b = num / 10 % 10;
    c = num / 100 % 10;
    d = num / 1000;
    printf("%d%d%d%d\n", a, b, c, d);
    return 0;
}